<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AJAX请求query</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
</head>
<body>
    名称：<input typye='text' id = 'key' />
    <button id="btnLoad">Load获取员工</button>
    <button id="btnGet">Get获取员工</button>
    <button id="btnAjax">Ajax获取员工</button>
    <div id="content"></div>
</body>
</html>
<script>
    $(document).ready(function(){
        $("#btnLoad").click(function () {
            var key=$('#key').val();
            $("#content").load('/app/emps1/?key='+ key );
        });
        $('#btnGet').click(function(){
            var key=$('#key').val();
            $.get('/app/emps1/',{'key':key},function(resp){
                // $('#content').text(resp);
                $('#content').html(resp);
            });
        });

        $('#btnAjax').click(function(){
            $.ajax({
                url:'/app/emps1/',
                data:{'key':$('#key').val()},
                type:'GET',
                success:function(resp){
                    $('#content').html(resp);
                }
            });
        });
    });
</script>